package com.ludomancy.spaceopera.entities;
import java.awt.Graphics;
import java.awt.Point;

import com.ludomancy.gamelib.ImageAnimation;
import com.ludomancy.spaceopera.BasicEntity;

public class Explosion extends BasicEntity
{
	private ImageAnimation anim;

	public Explosion(Point pos)
	{
		super(pos);
		z = ZFRONT;
		anim = ImageAnimation.create("explosion.png", 32, 32, 2);
		anim.play();
		width = (int) proj.screenToWorldX(anim.strip.frameWidth);
		height = (int) proj.screenToWorldY(anim.strip.frameHeight);
	}
	
	public void paint(Graphics g, int x, int y)
	{
		anim.update();
		anim.paintCurrentFrame(g, x, y);
	}
	
	public boolean update()
	{
		if(anim.isOver())
		{
			parent.remove(this);
		}
		return false;
	}
}
